﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;

namespace NinjaToolbox.SubComponentModule.Example
{
    [TargetModel(typeof(DamageSubComponent_Model))]
    public class DamageSubComponent_ModelEditor : SubComponentModelEditorBase
    {
        protected override float GetInspectorGUIHeight()
        {
            return 102;
        }

        protected override void OnInspectorGUI(Rect rect)
        {
            var model = mTarget as DamageSubComponent_Model;

            var height = rect.y;
            model.isAttackState = EditorGUI.Toggle(new Rect(rect.x, height, rect.width - 10, 20), "IsAttackState", model.isAttackState);
            height += 20;

            model.hp = EditorGUI.IntField(new Rect(rect.x, height, rect.width - 10, 20), "HP", model.hp);
            height += 20;

            model.toEnemyDamage = EditorGUI.IntField(new Rect(rect.x, height, rect.width - 10, 20), "ToEnemyDamage", model.toEnemyDamage);
            height += 20;

            model.ifHasDamageSentEvent = EditorGUI.Toggle(new Rect(rect.x, height, rect.width - 10, 20), "IfHasDamageSentEvent", model.ifHasDamageSentEvent);
            height += 20;

            model.godMode = EditorGUI.Toggle(new Rect(rect.x, height, rect.width - 10, 20), "God Mode", model.godMode);
            height += 20;
        }
    }
}
